package com.gump.mall.common.exception;

import com.gump.mall.common.api.IErrorCode;

/**
 * 自定义api异常
 * @auther zzc
 * @date 2020/9/10 23:59
 */
public class ApiException extends RuntimeException{

    private IErrorCode errorCode;

    public IErrorCode getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(IErrorCode errorCode) {
        this.errorCode = errorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(IErrorCode errorCode) {
        this.errorCode = errorCode;
    }

    public ApiException(String message, IErrorCode errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    public ApiException(String message, Throwable cause, IErrorCode errorCode) {
        super(message, cause);
        this.errorCode = errorCode;
    }

    public ApiException(Throwable cause, IErrorCode errorCode) {
        super(cause);
        this.errorCode = errorCode;
    }

    public ApiException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, IErrorCode errorCode) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.errorCode = errorCode;
    }
}
